package com.sun.controller;

import com.sun.dao.vo.Result;
import com.sun.dao.vo.params.LoginParam;
import com.sun.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("register")
public class RegisterController {
    @Autowired
    private LoginService loginService;

    /*@PostMapping
    public Result register(String account, String password,String nickname){
        LoginParam loginParam = new LoginParam();
        loginParam.setAccount(account);
        loginParam.setPassword(password);
        loginParam.setNickname(nickname);
        return loginService.register(loginParam);
    }*/

    @PostMapping
    public Result register(@RequestBody LoginParam loginParam){
        return loginService.register(loginParam);
    }

}
